{include file='header.html'}
<h1>Регистрация</h1>
<div class="form">
<form method="post" action="{geturl action='register'}" id="registration-form">

        <div class="error"{if !$fp->hasError()} style="display: none"{/if}>
            Одно или несколько полей заполнены неверно. Проверьте, пожалуйста, 
            поля с ошибками и отправьте форму ещё раз.
        </div>

        <div class="row" id="form_username_container">
             <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_username">Логин:</label></span>
            <span class="td4" style="padding: 5px;">  <input type="text" id="form_username"
                   name="login" value="{$fp->login|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('login')}</span>
        </div>
        
        <div class="row" id="form_password_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_password">Пароль:</label></span>
              <span class="td4" style="padding: 5px;"><input type="password" id="form_password"
                   name="password" value="{$fp->password|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('password')}</span>
        </div>
        
        <div class="row" id="form_password_again_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_email">Подтвердите пароль:</label></span>
             <span class="td4" style="padding: 5px;"> <input type="password" id="form_password_again"
                   name="password_again" value="{$fp->password_again|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('password_again')}</span>
        </div>

        <div class="row" id="form_first_name_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_company">Предприятие:</label></span>
             <span class="td4" style="padding: 5px;"> <input type="text" id="form_company"
                   name="company" value="{$fp->company|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('company')}</span>
        </div>

        <div class="row" id="form_region_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_region">Область:</label></span>
           <span class="td4" style="padding: 5px;">  <select name='region' id='form_region' onchange="region_city()" data-placeholder="Выбрать область" class="chosen-select_project" style="width:300px;" tabindex="4">
          
            {foreach from=$regions item=region}
            {if $region->getId()== $fp->region}
            <option value="{$region->getId()}" selected='selected'>{$region->name}</option>
            {else}
            <option value="{$region->getId()}">{$region->name}</option>
            {/if}
            {/foreach}
            </select>
            {include file='lib/error.tpl' error=$fp->getError('region')}</span>
        </div>
        
        <div class="row" id="form_city_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_city">Город:</label></span>
            <span class="td4" style="padding: 5px;">  <span id="cities">{if $cities} 
            <select name='city' id='form_city' data-placeholder="Выбрать город" class="chosen-select_city" style="width:300px;" tabindex="4">
            <option value='0'></option>
            {foreach from=$cities item=city}
            {if $city->getId()== $fp->city}
            <option value="{$city->getId()}" selected='selected'>{$city->name}</option>
            {else}
            <option value="{$city->getId()}">{$city->name}</option>
            {/if}
            {/foreach}
            </select>
              {/if}<span>
            {include file='lib/error.tpl' error=$fp->getError('city')}</span>
        </div>
        
        <div class="row" id="form_adress_container">
             <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_adress">Юридический адрес:</label></span>
            <span class="td4" style="padding: 5px;">  <input type="text" id="form_adress"
                   name="adress" value="{$fp->adress|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('adress')}</span>
        </div>
        
        <div class="row" id="form_real_adress_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_real_adress">Фактический адрес:</label></span>
            <span class="td4" style="padding: 5px;">  <input type="text" id="form_adress"
                   name="real_adress" value="{$fp->real_adress|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('real_adress')}</span>
        </div>
        
        <div class="row" id="form_company_phone_container">
             <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_company_phone">Телефон:</label> </span>
            <span class="td4" style="padding: 5px;">  <input type="text" id="form_company_form"
                   name="company_phone" value="{$fp->company_phone|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('company_phone')}</span>
        </div>
        
        <div class="row" id="form_code_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_code">Код ОКПОУ:</label></span>
            <span class="td4" style="padding: 5px;">  <input type="text" id="form_code"
                   name="code" value="{$fp->code|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('code')}</span>
        </div>
        
        <div class="row" id="form_password_again_container">
             <span class="td4" style="width:200px;padding-top: 5px;">   <label for="form_email">Выберите категории:</label></span>
           <span class="td4" style="padding: 5px;">   {foreach from=$cats item='cat'}
            <input type='checkbox' name='cats[]' value='{$cat->getId()}' /> {$cat->name|escape}
            {/foreach}
            {include file='lib/error.tpl' error=$fp->getError('category')}</span>
        </div>
        
        <div class="row" id="form_email_container">
               <span class="td4" style="width:200px;padding-top: 5px;"> <label for="form_email">E-mail:</label></span>
           <span class="td4" style="padding: 5px;">   <input type="text" id="form_email"
                   name="email" value="{$fp->email|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('email')}</span>
        </div>
        
        <div class="row" id="form_manager_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_manager">Контактное лицо:</label></span>
           <span class="td4" style="padding: 5px;">   <input type="text" id="form_manager"
                   name="manager" value="{$fp->manager|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('manager')}</span>
        </div>
        
        <div class="row" id="form_post_container">
              <span class="td4" style="width:200px;padding-top: 5px;">  <label for="form_post">Должность:</label></span>
           <span class="td4" style="padding: 5px;">   <input type="text" id="form_post"
                   name="post" value="{$fp->post|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('post')}</span>
        </div>
        
        <div class="row" id="form_phone_container">
            <span class="td4" style="width:200px;padding-top: 5px;">    <label for="form_phone">Телефон контактного лица:</label></span>
           <span class="td4" style="padding: 5px;">   <input type="text" id="form_form"
                   name="phone" value="{$fp->phone|escape}" />
            {include file='lib/error.tpl' error=$fp->getError('phone')}</span>
        </div>

        <div class="captcha">
            <span class="td4" style="padding-left: 70px;"> <img src="/utility/captcha" alt="CAPTCHA image" /></span>
        </div>

        <div class="row" id="form_captcha_container">
            <span class="td4" style="width:200px;padding-top: 5px;">    <label for="form_captcha">Введите код подтверждения:</label></span>
           <span class="td4" style="padding: 5px;">   <input type="text" id="form_captcha"
                   name="captcha" value="{$fp->captcha|escape}" />
               {include file='lib/error.tpl' error=$fp->getError('captcha')}</span>
        </div>

        <div class="submit">
            <input type="submit" value="Зарегистрироваться" />
        </div>

</form>
</div>

{include file='footer.html'}